<script>
    jQuery(document).ready(function($){
    
        $('#loading').ajaxStart(function() {
            $(this).show();
        }).ajaxStop(function() {
            $(this).hide();
        });
       
       $('.momentlink').click(function(){
           moment = $(this).attr('rel');
           $('#momentview').fadeOut('slow', function(){
            data = '<div class="loading center"><img src="../img/ajax-loader.gif" /></div>' ;
            $('#momentview').html(data);
            $('#momentview').fadeIn('slow');
            $('#momentview').fadeOut('slow', function(){
                $.post('moment/'+moment, function(data)
                {
                    $('#momentview').html(data);
                    $('#momentview').fadeIn('slow');
                });           
            })
        });
        });
    });
</script>
<?php
    $timeline = $this->requestAction('/time_lines/view/'.$id);
    //echo debug($timeline);
    for($i = 0; $i < count($timeline['Moment']); $i++)
    {
?>
        <div class="span-3 momentprev">
            <? echo $this->element('momentthumb', array('id' => $timeline['Moment'][$i]['id'])); ?>
        </div>
<?
    }
?>